/// Calculate the probability of birthday overlap in a group of `n` people.
///
/// # Algorithm
///
/// The probability of birthday overlap in a group of `n` people is calculated as follows:
///
/// P(overlap) = 1 - P(no overlap) = 1 - (365 / 365) * (364 / 365) *... * (365 - (n - 1) / 365)
pub fn new_birthday_probability(n: u32) -> f64 {
    let mut no_overlap = 1.0;

    for i in 0..n {
        const DAYS_IN_YEAR: f64 = 365.0;

        no_overlap *= (DAYS_IN_YEAR - i as f64) / DAYS_IN_YEAR;
    }

    // P(overlap) = 1 - P(no overlap)
    1.0 - no_overlap
}
